package com.massimilla.pet;

public class Pet {
    private String name;
    private String type;
    private String color;
    private int calories;
    Pet(){
        name = "Gemini";
        type = "cat";
        color = "blakc and white";
        calories = 3000;
    }
    Pet(String n){
        name = n;
        type= "cat";
        color = "black and white";
        calories = 3000;
    }
    Pet (String n, String t, String c){
        name = n;
        type = t;
        color = c;
        calories = 3000;
    }
    //Setter for name
    void setName(String n){
        if (n.length() <= 6)
            name = n;
        else
            name = n.substring(0,5);
    }
    //Getter for name
    String getName(){
        return name;
    }
    //Setter for type
    void setType(String t){
        if (t.length() <= 6)
            type = t;
        else
            type = t.substring(0,5);
    }
    //Getter for type   
    String getType(){
        return type;
    }
    //Setter for color
    void setColor(String c){
        if (c.length() <= 6)
            color = c;
        else
            color = c.substring(0,5);
    }
    //Getter for color
    String getColor(){
        return color;
    }
    //Getter for calories
    int getCalories() {
    return calories;
    }   
    //Setter for calories
    void setCalories(int a){
        if (calories < 8000);
            calories = a;
    }
    //class methods
    public void run(){
        calories = calories - 50;
    }
    public void eat(int a){
        setCalories(calories + a);
    }
}
